import java.util.concurrent.locks.ReentrantLock;

/**
 * @Author YuanYuan
 * @Date 2022/9/25
 * @Time 20:58
 */
public class TestDemo1 {
    public static void main(String[] args) {
        ReentrantLock locked = new ReentrantLock(true);
        try{
            //加锁
            locked.lock();
            locked.tryLock();
        }finally {
            //解锁
            locked.unlock();
        }

        ReentrantLock locker = new ReentrantLock(true);
    }
}
